package com.ethink.platform.controller.mdm;

import com.ethink.framework.common.web.BaseController;
import com.ethink.framework.common.web.response.CommonResponse;
import com.ethink.report.common.entity.AreaInfo;
import com.ethink.report.common.mapper.AreaMapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 辉辉 2022/12/23 13:35
 */
@Tag(name = "AreaController", description = "地区 Controller")
@RestController
@Slf4j
@RequestMapping("platform-server/v1/mdm-service")
public class AreaController extends BaseController {

    @Autowired
    private AreaMapper areaMapper;

    @Operation(summary = "查询区域名称和编码")
    @GetMapping("/area/listArea")
    public CommonResponse<List<AreaInfo>> listArea() {
        return succeedWith(areaMapper.listArea());
    }

}
